package android.olsson.apk;

import android.olsson.apk.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

//This is where the application starts
public class SplashScreen extends Activity {
	private final int SPLASH_TIME = 2000;
	private boolean SHOW_SPLASH = true;
	private final String TAG = "SPLASH_SCREEN_ERROR";

	private void startNextActivity() {
		startActivity(new Intent(SplashScreen.this,
				ApkSystembolagetActivity.class));
	}

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.splash_screen);
		Thread t = new Thread() {

			@Override
			public void run() {
				try {
					while (SHOW_SPLASH) {
						sleep(SPLASH_TIME);
						break;
					}
				} catch (InterruptedException e) {
					Log.e(TAG, e.toString());
				} finally {
					finish();
					startNextActivity();
				}
			}
		};
		t.start();
	}
}
